#pragma once

#include <vector>
#include <list>
#include <functional>
#include "Base/ThreadTool.h"
#include "Base/Singleton.h"

class CThreadTask;

class CThreadManager : public CSingleton<CThreadManager>
{
public:
	CThreadManager();
	~CThreadManager();

public:
	void init(int threadNumber);
	bool bindFunction(std::function<void(void)> func, time_t tickInterval);

private:
	std::list<self_thread_t> mThreadIDList;
	std::vector<CThreadTask*> mThreadTaskVector;
	int mAlreadyUsed;
	int mTaskPoolSize;
};

